feat: support user-defined custom commands in PR welcome message#1133
feat: support user-defined custom commands in PR welcome message#1133rnetser wants to merge 34 commits into
Conversation
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
PR Summary by QodoSupport user-defined custom commands in PR welcome message Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
Context used 1.
|
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
Looks good — the PR now covers the previously open items:
So at this point, the custom commands feature appears internally consistent across schema, rendering, and tests. |
|
Code review by qodo was updated up to the latest commit 51b41f1 |
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
Thanks — those items look addressed in
One note: the review index still shows finding 6 as active, so it may just be stale now. If you want, I can help verify that it’s safe to close. |
|
Code review by qodo was updated up to the latest commit 57db85f |
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
Thanks — both comments are addressed in the diff:
So the remaining review state looks stale rather than unresolved. |
Thanks — finding 6 is resolved.
|
|
@qodo-code-review Please re-evaluate all remaining sticky findings against the current code. |
I re-checked the only remaining sticky item and removed it:
No active sticky findings remain. |
|
/verified |
myakove
left a comment
There was a problem hiding this comment.
Code Review
Found 4 issue(s) in this PR:
💡 Suggestions (4)
| File | Line | Issue |
|---|---|---|
docs/configuration-reference.md |
302 | [CRITICAL] Manual edit to docs/ violates AGENTS.md rule |
webhook_server/libs/github_api.py |
1618 | [WARNING] Defensive None guard is dead code |
webhook_server/libs/github_api.py |
1635 | [WARNING] Log prefix leading space when empty |
webhook_server/libs/github_api.py |
1649 | [SUGGESTION] No collision check against built-in command names |
Review generated by pi
Review Finding (Round 7 — Soup Nazi Edition 🍜)
|
- Remove manual edits to docs/ (auto-generated by docsfy) - Replace dead None guard with isinstance(list) type check - Fix log_prefix leading space when empty - Add BUILTIN_COMMAND_NAMES collision check for built-in commands - Add test for builtin command name collision Co-authored-by: PI (claude-opus-4-6) <noreply@pi.dev> Signed-off-by: rnetser <rnetser@redhat.com> Assisted-by: Claude <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit 6589c8d |
Add reprocess, security-override, add-allowed-user, regenerate-welcome, and hold to the collision check set. Co-authored-by: PI (claude-opus-4-6) <noreply@pi.dev> Signed-off-by: rnetser <rnetser@redhat.com> Assisted-by: Claude <noreply@anthropic.com>
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
Acknowledged —
|
|
Code review by qodo was updated up to the latest commit 21770be |
Replace hardcoded string literals with COMMAND_*_STR and label constants. Also add COMMAND_AUTOMERGE_STR. Co-authored-by: PI (claude-opus-4-6) <noreply@pi.dev> Signed-off-by: rnetser <rnetser@redhat.com> Assisted-by: Claude <noreply@anthropic.com>
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
Yes — this addresses finding 6.
If you want, I can also sanity-check the remaining active findings for any similar constant duplication. |
|
Code review by qodo was updated up to the latest commit ce0a834 |
|
Fixed — PR description updated:
|
|
/build-and-push-container |
|
New container for ghcr.io/myk-org/github-webhook-server:pr-1133 published |
myakove
left a comment
There was a problem hiding this comment.
Code Review
Found 2 issue(s) in this PR:
💡 Suggestions (2)
| File | Line | Issue |
|---|---|---|
webhook_server/libs/github_api.py |
1622 | [WARNING] Log prefix inconsistency in early return |
webhook_server/libs/github_api.py |
1656 | [WARNING] Case-insensitive builtin check vs case-sensitive dupe check |
Review generated by pi
- Use log_msg_prefix in early isinstance return (was using raw prefix with leading space) - Make duplicate name detection case-insensitive via name.lower() - Update test for case-insensitive duplicate detection Co-authored-by: PI (claude-opus-4-6) <noreply@pi.dev> Signed-off-by: rnetser <rnetser@redhat.com> Assisted-by: Claude <noreply@anthropic.com>
|
@qodo-merge-pro please provide a final comprehensive review of the entire PR. List ALL findings at once — this is the last review pass before merge. @myakove — requesting your final review as well. Please post all remaining comments in one pass so we can address everything together. |
I don’t have any remaining findings to raise on this PR. Final review
SummaryThis PR looks ready to merge from my side. |
|
Code review by qodo was updated up to the latest commit b0245d2 |
…s-4-6) <noreply@pi.dev> Signed-off-by: rnetser <rnetser@redhat.com> Assisted-by: Claude <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit 94e819e |
|
Closing — scope changed from custom-commands to welcome-extra-info. New issue/PR to follow. |
|
Successfully removed PR tag: ghcr.io/myk-org/github-webhook-server:pr-1133. |
Summary
Add a
custom-commandsconfiguration option (global and per-repo) that renders user-defined commands in a new Custom Commands section of the PR welcome message. These are documentation-only — the server displays them but does not process them, allowing external bots/tools to handle them independently.Changes
webhook_server/config/schema.yamlcustom-commandsschema withname(pattern-constrained,^[a-zA-Z0-9_-]+$) anddescriptionfields. DRY via$defs.custom-command-itemreferenced from both global and per-repo.minItems: 1at global; per-repo allows empty list to disable.minLength: 1on both name and description.maxItems: 50on both arrays.webhook_server/libs/github_api.py_validate_custom_commands()load-time validator (matching_validate_custom_check_runspattern). Usesisinstancetype check,fullmatch()for safe-name regex, built-in command collision check, and log prefix handling for empty prefix.webhook_server/libs/handlers/pull_request_handler.py_prepare_custom_commands_welcome_sectionproperty and_escape_markdown()static method. Renders each command as* \/{name}` - {sanitized}. Markdown special chars and@` mentions escaped in descriptions.webhook_server/utils/constants.pyBUILTIN_COMMAND_NAMESfrozenset using existingCOMMAND_*_STRconstants for collision check against built-in commands.AGENTS.mdexamples/config.yamlcustom-commandsexample entries.pyproject.tomljsonschema>=4.0.0to tests dependency group.Tests added
webhook_server/tests/test_config_schema.pywebhook_server/tests/test_prepare_retest_welcome_comment.py_validate_custom_commandstests (including builtin collision)webhook_server/tests/test_config.pywebhook_server/tests/test_push_handler.pywebhook_server/tests/test_ai_cli.pyassert_awaited_once_with)webhook_server/tests/test_pull_request_review_handler.pyTesting
Closes #1132